package name.huzhenbo.java.algorithm.talent;

class CurrencyDivider {

    // 10 = 5 * x + 2 * y + 1 * z
    public void go() {
        for(int x = 0; x < 2; x++){
            for(int y = 0; y < 5; y++){
                int tempSum = 5 * x + 2 * y;
                if(tempSum > 10){
                    break;
                }
                for(int z = 0; z < 10; z++){
                    int sum = tempSum + z;
                    if(sum == 10){
                        System.out.println("5 cents: " + x + " 2 cents: " + y + " 1 cents: " + z);
                    }else if(sum > 10){
                        break;
                    }
                }
            }
        }
    }
}
